package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernateVO;

/**
 * CdReceiptStatus entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "cdReceiptStatus")
@GeneratorKey(tableName = "cdReceiptStatus")
public class CdReceiptStatusVO extends HibernateVO {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -7637413571528434649L;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cdReceiptStatus")
	private List<CdReceiptHeaderVO> cdReceiptHeaders;

	@Column(name = "name", nullable = false)
	private String name;

	@Id
	@Column(name = "receiptStatus", unique = true, nullable = false)
	private Integer receiptStatus;

	// Constructors

	/** default constructor */
	public CdReceiptStatusVO() {
		this.cdReceiptHeaders  = new ArrayList<CdReceiptHeaderVO>();
	}

	
	/**
	 * @return стойността на cdReceiptHeaders
	 */
	public List<CdReceiptHeaderVO> getCdReceiptHeaders() {
		return this.cdReceiptHeaders;
	}

	
	/**
	 * @param cdReceiptHeaders се залага в cdReceiptHeaders
	 */
	public void setCdReceiptHeaders(List<CdReceiptHeaderVO> cdReceiptHeaders) {
		this.cdReceiptHeaders = cdReceiptHeaders;
	}

	
	/**
	 * @return стойността на name
	 */
	public String getName() {
		return this.name;
	}

	
	/**
	 * @param name се залага в name
	 */
	public void setName(String name) {
		this.name = name;
	}

	
	/**
	 * @return стойността на receiptStatus
	 */
	public Integer getReceiptStatus() {
		return this.receiptStatus;
	}

	
	/**
	 * @param receiptStatus се залага в receiptStatus
	 */
	public void setReceiptStatus(Integer receiptStatus) {
		this.receiptStatus = receiptStatus;
	}

	/**
	 * @see com.acsior.dac.data.Data#getId()
	 */
	@Override
	public Object getId() {
		return getReceiptStatus();
	}

	/**
	 * @see com.acsior.dac.impl.hibernate.vo.HibernateVO#setId(java.lang.Object)
	 */
	@Override
	public void setId(Object id) {
		setReceiptStatus(Integer.class.cast(id));
	}

}